<%@ page import="com.sbdcpn.page.utils.RequestConstMessages,
				 com.sbdcpn.page.utils.PageStyleConstMessages,
				 com.sbdcpn.utils.factory.FactoryUtil,
				 com.sbdcpn.utils.system.FunEventUtil,
				 java.util.List,
				 java.util.Enumeration,
				 java.util.Map" %>
<%@ page import="com.sbdcpn.page.utils.RequestUtil, com.sbdcpn.utils.tools.CommonFun,	com.sbdcpn.utils.system.FunUtil" %>
<%
//	String strWhere = CommonFun.encodeURLParam(RequestUtil.getStringParameter(request ,"where_sql"));
//	String strValue = CommonFun.replaceURLCode(RequestUtil.getStringParameter(request ,"where_value"));
	String strWhere = RequestUtil.getStringParameter(request ,"where_sql");
	String strValue = RequestUtil.getStringParameter(request ,"where_value");
	String strType = RequestUtil.getStringParameter(request ,"where_type");
	String treeParentid1 = RequestUtil.getStringParameter(request ,"treeParentid");
	//System.out.println("=============================================>where_sql;where_value:where_type;treeParented = " + strWhere + ";" + strValue + ";" + strType + ";" + treeParentid1);
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
/**
 *
 */
function f_gridDblFunc(keyID) {
	var curKeyID = trselObj.f_get_select_key();
	curKeyID = curKeyID[0];
	if (curKeyID == "") return ;
	//alert("curKeyID = " + curKeyID);

	var qltid = trselObj.f_getTDValueByKeyName(curKeyID ,"view_in_mat_acc.qlt_in_id");
	var accid = trselObj.f_getTDValueByKeyName(curKeyID ,"view_in_mat_acc.acc_id");
/*
	var where_sql = " finance_carr_purc_deta.is_audited = '2' and finance_carr_purc_deta.provider_id = ? and finance_carr_purc_deta.carriage_mode = ? and finance_carr_purc_deta.cost_unit_id = ? and finance_carr_purc_deta.material_diff = ? ";
	var where_type = "string;string;string;string";
	var where_value = provider_id + ";" + carriage_mode+";"+cost_unit_id + ";" + matdiff;

	if (aflag != "") {
		where_sql += " and finance_carr_purc_deta.account_flag = '"+ aflag +"'";
	} else {
		where_sql += " and finance_carr_purc_deta.account_flag is null";
	}

	var contextPath = "<%=CONTEXTPATH%>";
	var funcid = "GROUPAUDIT_CARR_PURC";

	var href = contextPath + "/wzmis/finance/frame_groupaudit_purc_carr.jsp?funcid=" + funcid + "&pageType=grid";
	href += "&where_sql=" + where_sql;
	href += "&where_value=" + where_value;
	href += "&where_type=" + where_type;
*/
    //document.all("extend_param").value = qltid + ";" + accid;
  	var contextPath = "<%=CONTEXTPATH%>";
	var funcid = "material_qlt_detail";
	var sextend = qltid + ";" + accid;

	var href = contextPath + "/wzmis/stock/frame_groupaudit_mat_detail.jsp?funcid=" + funcid + "&pageType=grid&param_id=" + sextend;
	parent.frames("frmformdata").document.location = href;
}

function f_query() {
    var sstart = document.all("date_start").value;
    var send  = document.all("date_end").value;
    if (sstart == "" || send == "")  return;

	document.all("extend_param").value = sstart + ";" + send;
	var wheresql = document.all("where_sql").value;
	var wherevalue = document.all("where_value").value;
	var wheretype = document.all("where_type").value;

	if (wheresql == "") {
		wheresql = "view_in_mat_acc.plan_exe_date>=to_date('"+sstart+"', 'yyyy-mm-dd') and view_in_mat_acc.plan_exe_date<=to_date('"+
			send+"', 'yyyy-mm-dd')";
	} else {
		wheresql += " and view_in_mat_acc.plan_exe_date>=to_date('"+sstart+"', 'yyyy-mm-dd') and view_in_mat_acc.plan_exe_date<=to_date('"+
			send+"', 'yyyy-mm-dd')";
	}

	document.all("where_sql").value = wheresql;
	//alert("================================>wheresql = " + wheresql);
	f_reloadPage();
}

function f_setGrid() {
	var sparam = document.all("extend_param").value;
	if (sparam != "") {
		document.all("date_start").value = sparam.split(";")[0];
		document.all("date_end").value = sparam.split(";")[1];
	}
}
//-->
</SCRIPT>
<table>
<tr><td>
<label id="totalDate" class="gridData"><eam:message key="material.exe.date" />: </label>
<input type="text" name="date_start" id="date_start"  class="formEdit" size="18" align="center">--
<input type="text" name="date_end"  id="date_end"   class="formEdit" size="18" align="center">
<input type="button" name="query" id="query" value="<eam:message key="btn.keyquery" />" onclick = "f_query();">
</td></tr>
</table>